Added test for issue #1942
authormseri <mseri@users.noreply.github.com>
Sat, 29 Aug 2015 11:03:14 +0000 (12:03 +0100)
committermseri <mseri@users.noreply.github.com>
Sat, 29 Aug 2015 11:03:14 +0000 (12:03 +0100)
tests/test_cargo_run.rs

index 7d17d384385074b03e59bd2e1d6a21be61d02535..90bb1313e7c419b22c8f6cf9f2dbf2bd4d467cff 100644 (file)
@@ -461,3 +461,27 @@ test!(dashes_are_forwarded {
     assert_that(p.cargo_process("run").arg("--").arg("a").arg("--").arg("b"),
                 execs().with_status(0));
 });
+
+test!(run_from_executable_folder {
+    let p = project("foo")
+        .file("Cargo.toml", r#"
+            [project]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+        "#)
+        .file("src/main.rs", r#"
+            fn main() { println!("hello"); }
+        "#);
+
+    let cwd = p.root().join("target").join("debug");
+    p.cargo_process("build").exec_with_output().unwrap();
+
+    assert_that(p.cargo("run").cwd(cwd), 
+                execs().with_status(0).with_stdout(&format!("\
+{running} `./foo`
+hello
+",
+        running = RUNNING
+        )));
+});